//
//  ZpImageViewController.m
//  CJMobile
//
//  Created by manluqiusuo on 15/8/21.
//  Copyright (c) 2015年 长江证券. All rights reserved.
//

#import "PFImageViewController.h"
#import "UIImageView+WebCache.h"

@implementation PFImageViewController


- (void)viewDidLoad {
    
    UIImageView *imgView = [[UIImageView alloc]initWithFrame:self.view.frame];
    [imgView sd_setImageWithURL:[NSURL URLWithString:self.imgUrl] placeholderImage:[UIImage imageNamed:@"icon_person.png"]];
    imgView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    //添加点击事件
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgClicked:)];
    [self.view addGestureRecognizer:singleTap];

   
    [self.view addSubview:imgView];

}


- (id) initWithImgUrl:(NSString *)url{
    
    if( self = [super init] ){
        self.imgUrl = url;
    }
    return self;
}


-(void)imgClicked:(id)sender{
    
    [self dismissViewControllerAnimated:NO completion:nil];
}

@end
